package com.woniu.springbootrbac.mapper;

import com.woniu.springbootrbac.dto.PerDto;
import com.woniu.springbootrbac.entity.SysPermission;
import com.woniu.springbootrbac.vo.PerVo;
import com.woniu.springbootrbac.vo.TreeNode;

import java.util.List;

/**
* @author donghang
* @description 针对表【sys_permission】的数据库操作Mapper
* @createDate 2022-11-30 19:29:34
* @Entity com.woniu.springbootrbac.entity.SysPermission
*/
public interface SysPermissionMapper {

    /**
     * @Description 根据角色id删除该角色拥有的权限
     * @param rid
     * @Return int
     * @Author  fengSir
     * @Date    Create by 2022-11-30 15:59
     */
    int deleteByRid(Integer rid);
    /**
     * @Description 插入当前角色对应的权限
     * @param perDto
     * @Return int
     * @Author  fengSir
     * @Date    Create by 2022-11-30 15:59
     */
    int  insertPermission(PerDto perDto);
    /**
     * @Description 得到所有的权限
     * @param
     * @Return java.util.List<com.woniuxy.springbootrbac.vo.TreeNode>
     * @Author  fengSir
     * @Date    Create by 2022-11-30 15:06
     */
    List<TreeNode>  selectAllPer(Integer pid);
    /**
     * @Description 根据角色id,得到当前角色对应的权限id
     * @param rid
     * @Return java.util.List<java.lang.Integer>
     * @Author  fengSir
     * @Date    Create by 2022-11-30 15:07
     */
    List<Integer> selectPerByRid(Integer rid);

    List<PerVo> selectMenuByTel(String tel, Integer pid);

    int deleteByPrimaryKey(Long id);

    int insert(SysPermission record);

    int insertSelective(SysPermission record);

    SysPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    List<PerVo> selectPreVo(String tel,Integer pid);

}
